home *** CD-ROM | disk | FTP | other *** search
- property selectedCastList, theFilePath, theIFTXT
-
- on birth me
- global gmasterfolderpath, gDelimiter, gFileName
- set theFilePath to gmasterfolderpath & "GRAPHIC" & gDelimiter
- set theIFTXTPath to gmasterfolderpath & getProp(gFileName, #IFTXT)
- fileIOread(theIFTXTPath)
- set theIFTXT to the result
- if not (item 2 of line 1 of theIFTXT = "2") then
- alert("please use NEW IFbuilder")
- quit()
- end if
- return me
- end
-
- on importGraphic me, external
- global gSoundLevel, pushBtn, pushBtn, gPictTransition, gchaptertextheight, glessonnumber, gChapterBtnLocList, gVolumeBtnLocList, gColor, gFieldTop, onIBM, gIntroPictRect, gIntroMovieRect, gSpliteSetList, gDoorLoc, gDoorOpen, gIntroText2, gtextfont, grectlist
- if external = 0 then
- set the colorDepth to integer(item 1 of line 2 of theIFTXT)
- else
- set the colorDepth to external
- end if
- importCast(me, "BACKGND.PCT")
- importCast(me, "PLAY_UP.PCT")
- importCast(me, "PLAY_DN.PCT")
- importCast(me, "PAUSE_UP.PCT")
- importCast(me, "PAUSE_DN.PCT")
- importCast(me, "LEFT_UP.PCT")
- importCast(me, "LEFT_DN.PCT")
- importCast(me, "RIGHT_UP.PCT")
- importCast(me, "RIGHT_DN.PCT")
- importCast(me, "SLIDER.PCT")
- importCast(me, "VOLUME.PCT")
- importCast(me, "INDEX_UP.PCT")
- importCast(me, "INDEX_DN.PCT")
- importCast(me, "MENU_UP.PCT")
- importCast(me, "MENU_DN.PCT")
- importCast(me, "QUIT_UP.PCT")
- importCast(me, "QUIT_DN.PCT")
- importCast(me, "HELP_UP.PCT")
- importCast(me, "HELP_DN.PCT")
- importCast(me, "INDEXBKG.PCT")
- importCast(me, "RETURNUP.PCT")
- importCast(me, "RETURNDN.PCT")
- if integer(item 3 of line 2 of theIFTXT) = 0 then
- set theDoor to 0
- else
- set theDoor to 1
- importCast(me, "DOORB_UP.PCT")
- importCast(me, "DOORB_DN.PCT")
- importCast(me, "DOOR.PCT")
- end if
- set gSoundLevel to integer(item 2 of line 2 of theIFTXT)
- set the soundLevel to gSoundLevel
- set the puppet of sprite 47 to 1
- set the rect of sprite 47 to rect(0, 0, 640, 480)
- set the foreColor of sprite 47 to integer(item 4 of line 2 of theIFTXT)
- if integer(item 5 of line 2 of theIFTXT) then
- set gIntroPictRect to item 3 to 6 of line 5 of theIFTXT
- else
- set gIntroPictRect to EMPTY
- end if
- if integer(item 6 of line 2 of theIFTXT) then
- set gIntroMovieRect to item 3 to 6 of line 6 of theIFTXT
- else
- set gIntroMovieRect to EMPTY
- end if
- set gPictTransition to integer(item 7 of line 2 of theIFTXT)
- set the textFont of cast 32 to returnFont(item 1 of line 3 of theIFTXT)
- set the textSize of cast 32 to integer(item 2 of line 3 of theIFTXT)
- set the textHeight of cast 32 to integer(item 3 of line 3 of theIFTXT)
- set gchaptertextheight to integer(item 3 of line 3 of theIFTXT)
- set the textStyle of cast 32 to item 4 of line 3 of theIFTXT
- set the textFont of cast 33 to returnFont(item 1 of line 4 of theIFTXT)
- set the textSize of cast 33 to integer(item 2 of line 4 of theIFTXT)
- set the textHeight of cast 33 to integer(item 3 of line 4 of theIFTXT)
- set the textStyle of cast 33 to item 4 of line 4 of theIFTXT
- set gColor to []
- setSpriteRect(me, 7)
- set theRect to BoxToRect(item 3 to 6 of line 8 of theIFTXT)
- set the puppet of sprite 7 to 1
- set the rect of sprite 7 to theRect
- set the puppet of sprite 8 to 1
- set the rect of sprite 8 to theRect
- set theTextRect to BoxToRect(item 3 to 6 of line 10 of theIFTXT)
- setAt(theTextRect, 4, getAt(theTextRect, 2) + (gchaptertextheight * glessonnumber) + (gchaptertextheight / 2))
- set the puppet of sprite 9 to 1
- set the rect of cast 32 to theTextRect
- set the rect of sprite 9 to theTextRect
- if (getAt(theTextRect, 3) - getAt(theTextRect, 1)) > (getAt(theRect, 3) - getAt(theRect, 1)) then
- setAt(theTextRect, 4, getAt(theTextRect, 2) + (gchaptertextheight * glessonnumber))
- set the puppet of sprite 6 to 1
- set the rect of sprite 6 to theTextRect
- set gFieldTop to getAt(theTextRect, 2) - gchaptertextheight
- else
- setAt(theRect, 4, getAt(theRect, 2) + (gchaptertextheight * glessonnumber))
- set the puppet of sprite 6 to 1
- set the rect of sprite 6 to theRect
- set gFieldTop to getAt(theRect, 2) - gchaptertextheight
- end if
- setSpriteRect(me, 11)
- setSpriteRect(me, 12)
- setSpriteRect(me, 13)
- setSpriteRect(me, 14)
- setSpriteRect(me, 15)
- set theRect to BoxToRect(item 3 to 6 of line 16 of theIFTXT)
- set the puppet of sprite 15 to 1
- set the rect of cast 33 to theRect
- set the rect of sprite 15 to theRect
- setSpriteRect(me, 17)
- setSpriteRect(me, 18)
- setSpriteRect(me, 19)
- setSpriteRect(me, 20)
- set gSpliteSetList to []
- add(gSpliteSetList, [47, 48])
- if theDoor then
- set gDoorLoc to []
- set gDoorOpen to 0
- setSpriteRect(me, 21)
- setSpriteRect(me, 22)
- set DoorLoc to item 3 to 9 of line 33 of theIFTXT
- if item 8 of DoorLoc = EMPTY then
- set firstH to integer(item 1 of DoorLoc)
- set firstV to integer(item 2 of DoorLoc)
- set stepH to integer(item 3 of DoorLoc)
- set stepV to integer(item 4 of DoorLoc)
- set step to integer(item 5 of DoorLoc)
- repeat with m = 0 to step
- append(gDoorLoc, [firstH + (stepH * m), firstV + (stepV * m)])
- end repeat
- else
- set firstH to integer(item 1 of DoorLoc)
- set firstV to integer(item 2 of DoorLoc)
- set lastH to integer(item 6 of DoorLoc)
- set lastV to integer(item 7 of DoorLoc)
- set step to integer(item 5 of DoorLoc)
- set stepH to float(lastH - firstH) / step
- set stepV to float(lastV - firstV) / step
- repeat with m = 0 to step - 1
- append(gDoorLoc, [integer(firstH + (stepH * m)), integer(firstV + (stepV * m))])
- end repeat
- append(gDoorLoc, [lastH, lastV])
- end if
- add(gSpliteSetList, [1, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24])
- else
- add(gSpliteSetList, [1, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 24])
- end if
- set the puppet of sprite 24 to 1
- set the rect of sprite 24 to BoxToRect(item 3 to 6 of line 24 of theIFTXT)
- set the puppet of sprite 26 to 1
- set the rect of sprite 26 to BoxToRect(item 3 to 6 of line 25 of theIFTXT)
- setSpriteRect(me, 26)
- setSpriteRect(me, 27)
- set bigrect to item 3 to 6 of line 28 of theIFTXT
- set mediumrect to item 3 to 6 of line 29 of theIFTXT
- set smallrect to item 3 to 6 of line 30 of theIFTXT
- set soundrect to item 3 to 6 of line 30 of theIFTXT
- set gChapterBtnLocList to BoxToRect(item 3 to 6 of line 31 of theIFTXT)
- set gVolumeBtnLocList to BoxToRect(item 3 to 6 of line 32 of theIFTXT)
- set the ink of sprite 8 to 32
- set the blend of sprite 8 to integer(item 3 of line 34 of theIFTXT)
- set the foreColor of sprite 7 to integer(item 2 of line 35 of theIFTXT)
- set the foreColor of sprite 8 to integer(item 3 of line 35 of theIFTXT)
- add(gColor, returnRGB(integer(item 3 of line 37 of theIFTXT)))
- add(gColor, returnRGB(integer(item 5 of line 38 of theIFTXT)))
- add(gColor, returnRGB(integer(item 3 of line 36 of theIFTXT)))
- add(gColor, returnRGB(integer(item 2 of line 39 of theIFTXT)))
- add(gColor, returnRGB(integer(item 3 of line 39 of theIFTXT)))
- add(gColor, returnRGB(integer(item 4 of line 39 of theIFTXT)))
- add(gColor, integer(item 5 of line 39 of theIFTXT))
- add(gColor, integer(item 6 of line 39 of theIFTXT))
- set the foreColor of cast 32 to getAt(gColor, 1)
- set the foreColor of cast 33 to getAt(gColor, 3)
- set the foreColor of cast 35 to getAt(gColor, 6)
- set the foreColor of cast 34 to getAt(gColor, 4)
- set the puppet of sprite 29 to 1
- set the foreColor of sprite 29 to getAt(gColor, 7)
- set the rect of sprite 29 to rect(492, 107, 615, 119)
- set the puppet of sprite 30 to 1
- set the foreColor of sprite 30 to getAt(gColor, 8)
- set the rect of sprite 30 to rect(500, 108, 517, 117)
- set the puppet of sprite 31 to 1
- set the foreColor of sprite 31 to getAt(gColor, 8)
- set the rect of sprite 31 to rect(500, 385, 517, 394)
- set the puppet of sprite 37 to 1
- set the rect of sprite 37 to rect(492, 107, 615, 395)
- set the textFont of cast 34 to returnFont(item 7 of line 39 of theIFTXT)
- set the textFont of cast 35 to returnFont(item 7 of line 39 of theIFTXT)
- set the textSize of cast 34 to integer(item 8 of line 39 of theIFTXT)
- set the textSize of cast 35 to integer(item 8 of line 39 of theIFTXT)
- set the textHeight of cast 34 to integer(item 9 of line 39 of theIFTXT)
- set the textHeight of cast 35 to integer(item 9 of line 39 of theIFTXT)
- set the textStyle of cast 34 to item 10 of line 39 of theIFTXT
- set the textStyle of cast 35 to item 10 of line 39 of theIFTXT
- set the text of cast 37 to item 2 of line 40 of theIFTXT
- set gIntroText2 to item 2 of line 41 of theIFTXT
- set the foreColor of cast 37 to returnRGB(integer(item 3 of line 42 of theIFTXT))
- set the textFont of cast 37 to returnFont(item 4 of line 42 of theIFTXT)
- set the textSize of cast 37 to integer(item 5 of line 42 of theIFTXT)
- set the textHeight of cast 37 to integer(item 6 of line 42 of theIFTXT)
- set the textStyle of cast 37 to item 7 of line 42 of theIFTXT
- set theRect to BoxToRect(item 8 to 11 of line 42 of theIFTXT)
- set the rect of cast 37 to theRect
- set the puppet of sprite 48 to 1
- set the locH of sprite 48 to getAt(theRect, 1)
- set the locV of sprite 48 to getAt(theRect, 2)
- set the backColor of cast 86 to returnRGB(integer(item 2 of line 43 of theIFTXT))
- set the foreColor of cast 86 to returnRGB(integer(item 3 of line 43 of theIFTXT))
- set the textFont of cast 86 to returnFont(item 4 of line 43 of theIFTXT)
- set gtextfont to returnFont(item 4 of line 43 of theIFTXT)
- set the textSize of cast 86 to integer(item 5 of line 43 of theIFTXT)
- set the textHeight of cast 86 to integer(item 6 of line 43 of theIFTXT)
- set the textStyle of cast 86 to item 7 of line 43 of theIFTXT
- set theRect to BoxToRect(item 8 to 11 of line 43 of theIFTXT)
- setAt(theRect, 3, getAt(theRect, 3) - 16)
- set the rect of cast 86 to theRect
- set the puppet of sprite 22 to 1
- set the locH of sprite 22 to getAt(theRect, 1)
- set the locV of sprite 22 to getAt(theRect, 2)
- set grectlist to [bigrect, mediumrect, smallrect, soundrect]
- end
-
- on setSpriteRect me, n
- set spritenum to integer(item 2 of line n of theIFTXT)
- set the puppet of sprite spritenum to 1
- set the rect of sprite spritenum to BoxToRect(item 3 to 6 of line n of theIFTXT)
- end
-
- on importCast me, thepictname
- set thecastno to the number of cast thepictname
- importFileInto(cast thecastno, theFilePath & thepictname)
- set the regPoint of cast thecastno to point(the width of cast thecastno / 2, the height of cast thecastno / 2)
- end
-